package com.lzy.cloud;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.web.client.RestTemplate;

@EnableDiscoveryClient
@EnableFeignClients
@EnableEurekaClient
@EnableCircuitBreaker
@SpringBootApplication(exclude = MongoAutoConfiguration.class)
@MapperScan("com.lzy.cloud.consumer.mapper")
@Configuration
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 60*30)
public class LzyCloudConsumerApplication {

    @Bean
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    public static void main(String[] args) {
//        SpringApplication.run(LzyCloudConsumerApplication.class, args);
        new SpringApplicationBuilder(LzyCloudConsumerApplication.class).bannerMode(Banner.Mode.LOG).run(args);
    }


}
